{include file=member.header.html}
<div class="content">
    {include file=member.menu.html}
    <div id="right">
        {include file=member.curlocal.html}
        {include file=member.submenu.html}
        <div class="wrap">
            <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak={$baidu_ak}"></script>
            <div id="allmap" style="margin-bottom:10px;width:990px;height:600px;"></div>
            <div class="public">
                <form method="post">
                    <div class="user_search">
                        <span>{$lang.longitude}: </span>
                        <input id="lng" name="lng" class="text1 width13" type="text" value="{$store_info.lng}">
                        <span>{$lang.latitude}: </span>
                        <input id="lat" name="lat" class="text1 width13" type="text"  value="{$store_info.lat}">
                        <span>{$lang.rank}: </span>
                        <input id="zoom" name="zoom" class="text1 width13" type="text"  value="{$store_info.zoom}">
                        <input type="submit" class="btn" value="{$lang.save}">
                    </div>
                </form>
            </div>
            <script type="text/javascript">
// 百度地图API功能
                var map = new BMap.Map("allmap");

                var point = new BMap.Point({$store_info.lng}, {$store_info.lat});
                map.centerAndZoom(point, {$store_info.zoom});

                map.addControl(new BMap.NavigationControl());
                map.enableScrollWheelZoom();                            //启用滚轮放大缩小


                var marker = new BMap.Marker(point);  // 创建标注
                map.addOverlay(marker);              // 将标注添加到地图中
                marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
                

                map.addEventListener("click", function(e){
//                    alert(e.point.lng + ", " + e.point.lat);
                    map.clearOverlays();  //清除标注  或者可以把market 放入数组
                    var point = new BMap.Point(e.point.lng , e.point.lat);
                    var marker = new BMap.Marker(point);
                    map.addOverlay(marker);
                    marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
                    
                    document.getElementById("lng").value = e.point.lng;
                    document.getElementById("lat").value = e.point.lat;
                    document.getElementById("zoom").value = map.getZoom(10);
                });
                


            </script>







        </div>
    </div>
    <div class="clear"></div>
</div>
{include file=footer.html}
